package com.itbaizhan.controller;

import com.itbaizhan.pojo.Result;
import com.itbaizhan.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/c7")
public class MyController7 {
    @GetMapping("/addStudent")
    //@ResponseBody
    public Result addStudent(String name, String sex) {
        System.out.println(name + ":" + sex);
        Result result = new Result(true, "添加学生成功");
        return result;
    }

    @GetMapping("/t1")
    //@ResponseBody
    public Student test() {
        System.out.println("t1");
        Student student = new Student(1, "xujiale", "male", null);
        return student;
    }
}

